package com.zx.template.config;


import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.context.annotation.Configuration;

/**
 * 处理 @JsonSerialize(using = ToStringSerializer.class) 不生效的问题
 */
@Configuration
public class JacksonToStringConfig extends SimpleModule {
    
    public JacksonToStringConfig (){
        this.addSerializer(Long.class, ToStringSerializer.instance);
        this.addSerializer(Long.TYPE,ToStringSerializer.instance);
    }
}
